package com.bkgy.modular.tpdidata_cal1630.converter;

import com.bkgy.modular.tpdidata_cal1630.entity.TPdiCall1630Data_bao;
import com.bkgy.modular.tpdidata_cal1630.entity.TPdiDataCal1630;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 1630连退生产计划表转换器
 */
@Mapper(unmappedTargetPolicy = org.mapstruct.ReportingPolicy.IGNORE, unmappedSourcePolicy = org.mapstruct.ReportingPolicy.IGNORE, builder = @org.mapstruct.Builder(disableBuilder = true), nullValuePropertyMappingStrategy = org.mapstruct.NullValuePropertyMappingStrategy.IGNORE, nullValueCheckStrategy = org.mapstruct.NullValueCheckStrategy.ALWAYS, componentModel = "default", injectionStrategy = org.mapstruct.InjectionStrategy.CONSTRUCTOR, uses = {}, imports = {}, collectionMappingStrategy = org.mapstruct.CollectionMappingStrategy.ACCESSOR_ONLY, implementationName = "<CLASS_NAME>Impl", implementationPackage = "<PACKAGE_NAME>", mappingInheritanceStrategy = org.mapstruct.MappingInheritanceStrategy.EXPLICIT)
public interface TPdiDataCal1630Converter {

    TPdiDataCal1630Converter INSTANCE = Mappers.getMapper(TPdiDataCal1630Converter.class);

    // 入口卷号（连退入口卷号，酸轧出口卷号）
    @Mapping(source = "entid", target = "entid")
    // 来料厚度 -> 入口厚度
    @Mapping(source = "mthick", target = "inMatThk")
    // 来料宽度 -> 入口宽度
    @Mapping(source = "mwidth", target = "inMatWidth")
    // 来料重量 -> 入口重量
    @Mapping(source = "mweight", target = "in_mat_wt")
    // 来料长度 -> 入口长度
    @Mapping(source = "mlength", target = "in_mat_len")
    // 卷筒内径入口 -> 入口内径
    @Mapping(source = "mindia", target = "in_mat_inner_dia")
    // 卷筒外径入口 -> 入口外径
    @Mapping(source = "moutdia", target = "in_mat_outer_dia")
    // 过渡卷标志
    @Mapping(source = "n_dmyflag", target = "dumyflag")
    // 钢种
    @Mapping(source = "c_stlgrd", target = "steelgrade")
    // 张力代码
    @Mapping(source = "n_genstlgrd", target = "ten_code")
    // 钢种 -> 张力钢种代码
    @Mapping(source = "c_genstlgrd", target = "ten_grade")
    // 焊接代码
    @Mapping(source = "n_wldstlgrd", target = "weld_code")
    // 钢种 -> 焊接钢种代码
    @Mapping(source = "c_wldstlgrd", target = "weld_grade")
    // 退火曲线
    @Mapping(source = "n_ptstlgrd", target = "heatno")
    // 退火钢种牌号 -> 退火钢种代码
    @Mapping(source = "c_ptstlgrd", target = "heatno_grade")
    // 平整代码
    @Mapping(source = "n_rollstlgrd", target = "spm_code")
    // 平整钢种 -> 平整钢种代码
    @Mapping(source = "c_rollstlgrd", target = "spm_grade")
    // 退火炉张力补偿代码
    @Mapping(source = "n_curveid", target = "fur_ten_pay_code")
    // 退火炉张力代码
    @Mapping(source = "n_heatcyclecode", target = "fur_ten_code")
    // 返修标志
    @Mapping(source = "n_repairflag", target = "repairflag")
    // 套筒模式
    @Mapping(source = "n_sleevemode", target = "sleevemode")
    // 合同号
    @Mapping(source = "c_orderno", target = "orderno")
    // 出口计划厚度 -> 出口目标厚度
    @Mapping(source = "n_delthk", target = "exthk_aim")
    // 目标出口宽度 -> 出口目标宽度
    @Mapping(source = "n_delwid", target = "exwidth_aim")
    // 计划出口长度 -> 出口目标长度
    @Mapping(source = "n_dellen", target = "exlen_aim")
    // 目标重量
    @Mapping(source = "i_delcoilwttarg", target = "exwt_aim")
    // 出口内径
    @Mapping(source = "n_delindia", target = "out_mat_inner_dia")
    // 出口外径
    @Mapping(source = "n_deloutdia", target = "out_mat_outer_dia")
    // 切边标志 -> 切边模式
    @Mapping(source = "c_stmode", target = "trimmode")
    // 切边宽度
    @Mapping(source = "n_stwid", target = "trim_width")
    // 切边标志
    @Mapping(source = "n_trimflag", target = "trimflag")
    // 取样标志
    @Mapping(source = "n_sampleflag", target = "sampleflag")
    // 取样目的
    @Mapping(source = "c_sampleorder", target = "sampleorder")
    // 取样位置
    @Mapping(source = "c_sampleplace", target = "samplepos")
    // 样板长度
    @Mapping(source = "n_samplelen", target = "samplelen")
    // 取样频率
    @Mapping(source = "c_samplecode", target = "samplerate")
    // 平整机标志
    @Mapping(source = "c_spmuse", target = "spmuse")
    // 生产时间
    @Mapping(source = "n_spmrough", target = "spmtime")
    // 涂头种类 -> 涂油类型
    @Mapping(source = "c_oilkind", target = "oiltype")
    // 涂油代码
    @Mapping(source = "c_oilcode", target = "oilcode")
    // 涂油量
    @Mapping(source = "n_oilamount", target = "oilamount")
    // 前道工序代码
    @Mapping(source = "c_prelinecode", target = "preprocess")
    // 后道工序代码
    @Mapping(source = "c_nextlinecode", target = "nextprocess")
    // 销售渠道 -> 分配方式
    @Mapping(source = "c_smooth", target = "distribution")
    // 平坦度代码
    @Mapping(source = "c_flatcode", target = "flatcode")
    // 平整方式代码
    @Mapping(source = "c_spmcustcode", target = "spm_mode")
    // 延伸率目标值
    @Mapping(source = "n_elongtarg", target = "elongAim")
    // 粗糙度目标值
    @Mapping(source = "n_roughtarg", target = "rough_aim")
    // 粗糙度最大值
    @Mapping(source = "n_roughmax", target = "rough_max")
    // 粗糙度最小值
    @Mapping(source = "n_roughmin", target = "rough_min")
    // 头部厚度公差长度
    @Mapping(source = "n_thickofgheadlen", target = "thk_head_tole_len")
    // 头部厚度公差平均值
    @Mapping(source = "n_thickofgheadave", target = "thk_head_tole_avg")
    // 头部厚度公差最小值
    @Mapping(source = "n_thickofgheadmin", target = "thk_head_tole_min")
    // 头部厚度公差最大值
    @Mapping(source = "n_thickofgheadmax", target = "thk_head_tole_max")
    // 尾部厚度公差长度
    @Mapping(source = "n_thickofgtaillen", target = "thk_tail_tole_len")
    // 尾部厚度公差平均值
    @Mapping(source = "n_thickofgtailave", target = "thk_tail_tole_avg")
    // 尾部厚度公差最小值
    @Mapping(source = "n_thickofgtailmin", target = "thk_tail_tole_min")
    // 尾部厚度公差最大值
    @Mapping(source = "n_thickofgtailmax", target = "thk_tail_tole_max")
    // 包装代码
    @Mapping(source = "c_custcode", target = "package_code")
    // 创建时间
    @Mapping(expression = "java(com.bkgy.util.DateUtil.getdatetostring(tPdiCall1630Data_bao.getToc()))", target = "toc")
    // 修改时间
    @Mapping(expression = "java(com.bkgy.util.DateUtil.getdatetostring(tPdiCall1630Data_bao.getTom()))", target = "tom")
    // 操作员
    @Mapping(source = "mop", target = "mop")
    // 修改人
    @Mapping(source = "mou", target = "mou")
    // 生产标志（宝信系统无对应数据）
    @Mapping(target = "prod_flag", ignore = true)
    // 入口厚度分级（宝信系统无对应数据）
    @Mapping(target = "enthk_class", ignore = true)
    // 出口厚度分级（宝信系统无对应数据）
    @Mapping(target = "exthk_class", ignore = true)
    // 入口宽度分级（宝信系统无对应数据）
    @Mapping(target = "enwidth_class", ignore = true)
    // 出口宽度分级（宝信系统无对应数据）
    @Mapping(target = "exwidth_class", ignore = true)
    // 屈服强度等级（宝信系统无对应数据）
    @Mapping(target = "yp_class", ignore = true)
    // 创建时间（宝信系统无对应数据） todo 确认时间是否为系统生成
    @Mapping(target = "create_time", expression = "java(new java.util.Date())")
    // 入口单据号（宝信系统无对应数据）
    @Mapping(target = "indocno", ignore = true)
    // 热轧卷号（宝信系统无对应数据）
    @Mapping(target = "hot_coil_id", ignore = true)
    // 出口宽度
    @Mapping(target = "exwidth", source = "out_mat_width")
    // 出口宽度最小值（宝信系统无对应数据）
    @Mapping(target = "exwidth_min", ignore = true)
    // 出口宽度最大值（宝信系统无对应数据）
    @Mapping(target = "exwidth_max", ignore = true)
    // 取样频率代码（宝信系统无对应数据）
    @Mapping(target = "sampleratecode", ignore = true)
    // 表面精度代码（宝信系统无对应数据）
    @Mapping(target = "surface_accu_code", ignore = true)
    // 订货厚度（来自MES表）
    @Mapping(source = "order_thick", target = "order_thick")
    @Mapping(source = "order_width", target = "order_width")
    @Mapping(source = "order_unit_min_wt", target = "order_unit_wt_min")
    @Mapping(source = "order_unit_max_wt", target = "order_unit_wt_max")
    @Mapping(source = "order_inner_dia", target = "order_inner_dia")
    @Mapping(source = "factory_id", target = "factory_id")
    @Mapping(source = "fin_cust_cname", target = "fin_cust_cname")
    @Mapping(source = "surf_defect_mark1", target = "defect_mark")
    @Mapping(source = "output_ph", target = "hour_wt")
    @Mapping(source = "output_se", target = "preduration")
    TPdiDataCal1630 toTPdiDataCal1630(TPdiCall1630Data_bao tPdiCall1630Data_bao);
}